@echo Deploying FBAManagement solution

@set PATH=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN;%PATH%

@if "%1"=="" (goto invalidParameters) 

stsadm -o deactivatefeature -name FBAManagementSelf -url %1 -force
stsadm -o deactivatefeature -name FBAManagementAdmin -url %1 -force

stsadm -o uninstallfeature -name FBAManagementSelf -force
stsadm -o uninstallfeature -name FBAManagementAdmin -force

stsadm -o retractsolution -name CKS.FBA.wsp -immediate -url %1
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name CKS.FBA.wsp -override

stsadm -o addsolution -filename CKS.FBA.wsp
stsadm -o deploysolution -name CKS.FBA.wsp -immediate -allowgacdeployment -force -url %1
stsadm -o execadmsvcjobs

stsadm -o installfeature -name FBAManagementSelf -force
stsadm -o installfeature -name FBAManagementAdmin -force

stsadm -o activatefeature -name FBAManagementSelf -url %1
stsadm -o activatefeature -name FBAManagementAdmin -url %1

@goto endOfBatch

:invalidParameters
	@echo Please call with the correct parameters.
	@echo The correct syntax of this command is:
	@echo Deploy [siteurl]	

:endOfBatch